<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
/*
    var num1 = 123;
    var num2;
    num2 = num1;

    console.log( 'num1 = ' + num1 );
    console.log( 'num2 = ' + num2 );

    num1 = 456;
    console.log( 'num1 = ' + num1 );
    console.log( 'num2 = ' + num2 );
*/


    var o1 = { num: 123 };

    var o2;

    o2 = o1;

    console.log( 'o1.num = ' + o1.num );
    console.log( 'o2.num = ' + o2.num );


    o1.num = 456;
    
    console.log( 'o1.num = ' + o1.num );
    console.log( 'o2.num = ' + o2.num );

</script>
</html>